feat: support searching and sorting items by enchantment name and level#17
Open
ags816710 wants to merge 2 commits into
Open
feat: support searching and sorting items by enchantment name and level#17ags816710 wants to merge 2 commits into
ags816710 wants to merge 2 commits into
Conversation
…e 3", "fortune iii", etc) - Update enchantment matching logic to parse search queries word-by-word. - Add Roman numeral conversion to support Minecraft's native level formatting (I, II, III, etc.) - hardcoded for now - Ensure both regular enchanted items and Enchanted Books are correctly filtered by their specific enchantment levels.
- Add `getSortName` utility to append the primary enchantment name to the base item name and and zero-padded level for sorting. - Ensures enchanted books remain grouped together under "Enchanted Book" while sorting logically by their specific enchantment (e.g., "Enchanted Book - Mending" before "Enchanted Book - Sharpness"). - Ensures enchanted books display in ascending order of level (e.g. Efficiency IV appears after Efficiency II) - Applies to both stored enchants (books) and regular enchanted gear.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the ability to search for items in the terminal by their enchantment names and levels (e.g., typing "Fortune 3" or "Sharpness IV"). It also updates the alphabetical sorting logic so that enchanted books and gear are grouped by their base name, but sorted logically by their specific enchantment and level (e.g., Sharpness I appears before Sharpness V).
Roman numerals are currently hardcoded from I -> X, might change this to something better if needed though.